<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="/css/layui.css">
    <link rel="stylesheet" href="/css/bootstrap.min.css">
</head>

<ul class="layui-nav" lay-filter="">
    <li class="layui-nav-item" style="margin-left: 100px" ;><a href="javascript:;">产品介绍</a></li>
    <li class="layui-nav-item layui-this" style="margin-left: 100px" ;><a href="javascript:;">免费模板</a></li>
    <li class="layui-nav-item" style="margin-left: 100px" ;><a href="javascript:;">问卷评价</a></li>

    <li class="layui-nav-item" style="margin-left: 100px;">
        <a href="javascript:;">企业服务</a>
        <dl class="layui-nav-child">
            <!-- 二级菜单 -->
            <dd><a href="javascript:;">开放平台</a></dd>
            <dd><a href="javascript:;">专业调研服务</a></dd>
            <dd><a href="javascript:;">商务合作</a></dd>
        </dl>
    </li>
    <li class="layui-nav-item"
        style="margin-left: 4                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        00px;">
        <a href="javascript:;">个人中心</a>
        <dl class="layui-nav-child">
            <!-- 二级菜单 -->

            <dd><a href="/logout">注销</a></dd>
            <dd><a href="/setting">信息修改</a></dd>
          
        </dl>
    </li>
 
</ul>


<h5>您好:&nbsp;&nbsp;{{personer}} </h5>


<div class="layui-row layui-col-space15">
    {% for question in questions %}
    <div class="layui-col-md6">
        <div class="layui-panel cord">
            <div style="padding: 30px; color: coral;">
                <div class="cordrow" style="font-size: 25px;">问卷题目:{{question.title}}</div>
                <div class="cordrow" style="font-size: 25px;">问卷说明:{{question.instruction}}</div>
                <br>
                <br>
                <br>
                <br>
                <a class="corda" href="javascript:void(0);" onclick="writeque('{{question.id}}')">填写问卷</a>
                </td>

            </div>
        </div>
    </div>
    {% endfor %}
</div>



<script src="/js/jquery-3.6.0.min.js"></script>
<script src="/layui.js"></script>
<script>



    //通过所点击填写问卷获取到survey里的id   
    function writeque(id1) {
        let data = {
            sid: id1
        }

        $.ajax({
            url: "/writequestion",
            type: "POST",
            dataType: "json",
            data: data,
            success: function (res) {
                if (res.code === 200) {
                    window.location.href = "/writequestioned";
                }
            },
            error: function (msg) {
                console.log('网络或者服务器有问题');
            }
        })
    }


    //注意：导航 依赖 element 模块，否则无法进行功能性操作
    layui.use('element', function () {
        var element = layui.element;

    });


</script>
</body>

</html>